package test.client.support.time;

public class TimeTracker {
	private Long start;
	private Long elapsed;
	
	private boolean started = false;
	
	public void start() {
		this.start = System.currentTimeMillis();
		this.started = true;
	}
	
	public void stop() {
		if (!this.started)
			throw new IllegalStateException("TimeTracker is not started.");
		
		this.elapsed = System.currentTimeMillis() - start;
		this.started = false;
	}

	public Long getStart() {
		return start;
	}

	public Long getElapsed() {
		return elapsed;
	}

	public boolean isRunning() {
		return started;
	}
}
